package com.hung.triple.common.utils;

import java.net.http.HttpClient;

/**
 * @author Hung
 * @date 2023/2/1 1:04
 */
public class HttpClientUtil {


    static volatile HttpClient httpClient;

    public static HttpClient getHttpClient() {
        if (httpClient == null) {
            synchronized (HttpClientUtil.class) {
                if (httpClient == null) {
                    httpClient = HttpClient.newHttpClient();
                }
            }
        }

        return httpClient;
    }
}
